﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace WAI
{
    public class WizardSheet : System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public WizardSheet()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.backButton = new System.Windows.Forms.Button();
            this.nextButton = new System.Windows.Forms.Button();
            this.finishButton = new System.Windows.Forms.Button();
            this.cancelButton = new System.Windows.Forms.Button();
            this.buttonPanel = new System.Windows.Forms.Panel();
            this.pagePanel = new System.Windows.Forms.Panel();
            this.etchedLine1 = new WAI.EtchedLine();
            this.buttonPanel.SuspendLayout();
            this.SuspendLayout();
            // 
            // backButton
            // 
            this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.backButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.backButton.Location = new System.Drawing.Point(516, 8);
            this.backButton.Name = "backButton";
            this.backButton.Size = new System.Drawing.Size(75, 23);
            this.backButton.TabIndex = 0;
            this.backButton.Text = "< &Back";
            this.backButton.Click += new System.EventHandler(this.backButton_Click);
            // 
            // nextButton
            // 
            this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.nextButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.nextButton.Location = new System.Drawing.Point(590, 8);
            this.nextButton.Name = "nextButton";
            this.nextButton.Size = new System.Drawing.Size(75, 23);
            this.nextButton.TabIndex = 1;
            this.nextButton.Text = "&Next >";
            this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
            // 
            // finishButton
            // 
            this.finishButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.finishButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.finishButton.Location = new System.Drawing.Point(590, 8);
            this.finishButton.Name = "finishButton";
            this.finishButton.Size = new System.Drawing.Size(75, 23);
            this.finishButton.TabIndex = 4;
            this.finishButton.Text = "&Create";
            this.finishButton.Click += new System.EventHandler(this.createButton_Click);
            // 
            // cancelButton
            // 
            this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cancelButton.Location = new System.Drawing.Point(678, 8);
            this.cancelButton.Name = "cancelButton";
            this.cancelButton.Size = new System.Drawing.Size(75, 23);
            this.cancelButton.TabIndex = 3;
            this.cancelButton.Text = "Cancel";
            this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
            // 
            // buttonPanel
            // 
            this.buttonPanel.Controls.Add(this.etchedLine1);
            this.buttonPanel.Controls.Add(this.cancelButton);
            this.buttonPanel.Controls.Add(this.backButton);
            this.buttonPanel.Controls.Add(this.finishButton);
            this.buttonPanel.Controls.Add(this.nextButton);
            this.buttonPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.buttonPanel.Location = new System.Drawing.Point(0, 535);
            this.buttonPanel.Name = "buttonPanel";
            this.buttonPanel.Size = new System.Drawing.Size(766, 40);
            this.buttonPanel.TabIndex = 4;
            // 
            // pagePanel
            // 
            this.pagePanel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pagePanel.Location = new System.Drawing.Point(0, 0);
            this.pagePanel.Name = "pagePanel";
            this.pagePanel.Size = new System.Drawing.Size(766, 535);
            this.pagePanel.TabIndex = 5;
            // 
            // etchedLine1
            // 
            this.etchedLine1.Dock = System.Windows.Forms.DockStyle.Top;
            this.etchedLine1.Edge = WAI.EtchEdge.Top;
            this.etchedLine1.Location = new System.Drawing.Point(0, 0);
            this.etchedLine1.Name = "etchedLine1";
            this.etchedLine1.Size = new System.Drawing.Size(766, 8);
            this.etchedLine1.TabIndex = 4;
            // 
            // WizardSheet
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(766, 575);
            this.Controls.Add(this.pagePanel);
            this.Controls.Add(this.buttonPanel);
            this.Name = "WizardSheet";
            this.Text = "WizardSheet";
            this.Load += new System.EventHandler(this.WizardSheet_Load);
            this.Closing += new System.ComponentModel.CancelEventHandler(this.WizardSheet_Closing);
            this.buttonPanel.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button backButton;
        private System.Windows.Forms.Button nextButton;
        private System.Windows.Forms.Button finishButton;
        private System.Windows.Forms.Button cancelButton;
        private System.Windows.Forms.Panel buttonPanel;
        private EtchedLine etchedLine1;
        private System.Windows.Forms.Panel pagePanel;
        public string WebAppName;

        private IList _pages = new ArrayList();
        private WizardPage _activePage;

        private void WizardSheet_Load(object sender, System.EventArgs e)
        {
            if (_pages.Count != 0)
            {
                ResizeToFit();
                SetActivePage(0);
            }
            else
                SetWizardButtons(WizardButtons.None);
        }

        private void ResizeToFit()
        {
            Size maxPageSize = new Size(buttonPanel.Width, 0);

            foreach (WizardPage page in _pages)
            {
                if (page.Width > maxPageSize.Width)
                    maxPageSize.Width = page.Width;
                if (page.Height > maxPageSize.Height)
                    maxPageSize.Height = page.Height;
            }

            foreach (WizardPage page in _pages)
            {
                page.Size = maxPageSize;
            }

            Size extraSize = this.Size;
            extraSize -= pagePanel.Size;

            Size newSize = maxPageSize + extraSize;
            this.Size = newSize;
        }

        public IList Pages
        {
            get { return _pages; }
        }

        private int GetActiveIndex()
        {
            WizardPage activePage = GetActivePage();

            for (int i = 0; i < _pages.Count; ++i)
            {
                if (activePage == _pages[i])
                    return i;
            }

            return -1;
        }

        private WizardPage GetActivePage()
        {
            return _activePage;
        }

        public void SetActivePage(int pageIndex)
        {
            if (pageIndex < 0 || pageIndex >= _pages.Count)
                throw new ArgumentOutOfRangeException("pageIndex");

            WizardPage page = (WizardPage)_pages[pageIndex];
            SetActivePage(page);
        }

        private WizardPage FindPage(string pageName)
        {
            foreach (WizardPage page in _pages)
            {
                if (page.Name == pageName)
                    return page;
            }

            return null;
        }

        private void SetActivePage(string newPageName)
        {
            WizardPage newPage = FindPage(newPageName);

            if (newPage == null)
                throw new Exception(string.Format("Can't find page named {0}", newPageName));

            SetActivePage(newPage);
        }

        private void SetActivePage(WizardPage newPage)
        {
            WizardPage oldActivePage = _activePage;

            // If this page isn't in the Controls collection, add it.
            // This is what causes the Load event, so we defer
            // it as late as possible.
            if (!pagePanel.Controls.Contains(newPage))
                pagePanel.Controls.Add(newPage);

            // Show this page.
            newPage.Visible = true;

            _activePage = newPage;
            CancelEventArgs e = new CancelEventArgs();
            newPage.OnSetActive(e);

            if (e.Cancel)
            {
                newPage.Visible = false;
                _activePage = oldActivePage;
            }

            // Hide all of the other pages.
            foreach (WizardPage page in _pages)
            {
                if (page != _activePage)
                    page.Visible = false;
            }
        }

        internal void SetWizardButtons(WizardButtons buttons)
        {
            backButton.Enabled = ((buttons & WizardButtons.Back) != 0);

            if ((buttons & WizardButtons.Finish) != 0)
            {
                finishButton.Visible = true;
                finishButton.Enabled = true;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = finishButton;
            }

            else
            {
                finishButton.Visible = false;
                finishButton.Enabled = false;

                nextButton.Visible = true;
                nextButton.Enabled = ((buttons & WizardButtons.Next) != 0);

                this.AcceptButton = nextButton;
            }
        }

        private WizardPageEventArgs PreChangePage(int delta)
        {
            // Figure out which page is next.
            int activeIndex = GetActiveIndex();
            int nextIndex = activeIndex + delta;

            if (nextIndex < 0 || nextIndex >= _pages.Count)
                nextIndex = activeIndex;

            // Fill in the event args.
            WizardPage newPage = (WizardPage)_pages[nextIndex];

            WizardPageEventArgs e = new WizardPageEventArgs();
            e.NewPage = newPage.Name;
            e.Cancel = false;

            return e;
        }

        private void PostChangePage(WizardPageEventArgs e)
        {
            if (!e.Cancel)
                SetActivePage(e.NewPage);
        }

        private void nextButton_Click(object sender, System.EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(+1);
            _activePage.OnWizardNext(wpea);
            PostChangePage(wpea);
        }

        private void backButton_Click(object sender, System.EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(-1);
            _activePage.OnWizardBack(wpea);
            PostChangePage(wpea);
        }

        private void finishButton_Click(object sender, System.EventArgs e)
        {
            CancelEventArgs cea = new CancelEventArgs();
            _activePage.OnWizardFinish(cea);
            if (cea.Cancel)
                return;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void createButton_Click(object sender, System.EventArgs e)
        {
            CancelEventArgs cea = new CancelEventArgs();
            _activePage.OnWizardFinish(cea);
            if (cea.Cancel)
                return;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        internal void PressButton(WizardButtons buttons)
        {
            if ((buttons & WizardButtons.Finish) == WizardButtons.Finish)
                finishButton.PerformClick();
            else if ((buttons & WizardButtons.Next) == WizardButtons.Next)
                nextButton.PerformClick();
            else if ((buttons & WizardButtons.Back) == WizardButtons.Back)
                backButton.PerformClick();
        }

        internal void EnableCancelButton(bool enableCancelButton)
        {
            cancelButton.Enabled = enableCancelButton;
        }

        private void cancelButton_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }

        private void WizardSheet_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!cancelButton.Enabled)
                e.Cancel = true;
            else if (!finishButton.Enabled)
                OnQueryCancel(e);
        }

        protected virtual void OnQueryCancel(CancelEventArgs e)
        {
            _activePage.OnQueryCancel(e);
        }
    }

    [Flags]
    public enum WizardButtons
    {
        None = 0x0000,
        Back = 0x0001,
        Next = 0x0002,
        Finish = 0x0004,
        Create = 0x0008,
    }

    public class WizardPageEventArgs : CancelEventArgs
    {
        string _newPage = null;

        public string NewPage
        {
            get { return _newPage; }
            set { _newPage = value; }
        }
    }

    public delegate void WizardPageEventHandler(object sender, WizardPageEventArgs e);

    public class EtchedLine : System.Windows.Forms.UserControl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public EtchedLine()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // Avoid receiving the focus.
            SetStyle(ControlStyles.Selectable, false);
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                    components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            // 
            // EtchedLine
            // 
            this.Name = "EtchedLine";
        }
        #endregion

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Brush lightBrush = new SolidBrush(_lightColor);
            Brush darkBrush = new SolidBrush(_darkColor);
            Pen lightPen = new Pen(lightBrush, 1);
            Pen darkPen = new Pen(darkBrush, 1);

            if (this.Edge == EtchEdge.Top)
            {
                e.Graphics.DrawLine(darkPen, 0, 0, this.Width, 0);
                e.Graphics.DrawLine(lightPen, 0, 1, this.Width, 1);
            }
            else if (this.Edge == EtchEdge.Bottom)
            {
                e.Graphics.DrawLine(darkPen, 0, this.Height - 2,
                    this.Width, this.Height - 2);
                e.Graphics.DrawLine(lightPen, 0, this.Height - 1,
                    this.Width, this.Height - 1);
            }
        }

        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            Refresh();
        }

        Color _darkColor = SystemColors.ControlDark;

        [Category("Appearance")]
        Color DarkColor
        {
            get { return _darkColor; }

            set
            {
                _darkColor = value;
                Refresh();
            }
        }

        Color _lightColor = SystemColors.ControlLightLight;

        [Category("Appearance")]
        Color LightColor
        {
            get { return _lightColor; }

            set
            {
                _lightColor = value;
                Refresh();
            }
        }

        EtchEdge _edge = EtchEdge.Top;

        [Category("Appearance")]
        public EtchEdge Edge
        {
            get
            {
                return _edge;
            }

            set
            {
                _edge = value;
                Refresh();
            }
        }
    }

    public enum EtchEdge
    {
        Top, Bottom
    }

    public class ExternalWizardPage : WizardPage
    {
        public WizardSidebar Sidebar;
        private System.ComponentModel.IContainer components = null;

        public ExternalWizardPage()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Sidebar = new WizardSidebar();
            this.SuspendLayout();
            // 
            // Sidebar
            // 
            this.Sidebar.Dock = System.Windows.Forms.DockStyle.Left;
            this.Sidebar.Location = new System.Drawing.Point(0, 0);
            this.Sidebar.Name = "Sidebar";
            this.Sidebar.Size = new System.Drawing.Size(165, 208);
            this.Sidebar.TabIndex = 0;
            // 
            // ExternalWizardPage
            // 
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.Sidebar);
            this.Name = "ExternalWizardPage";
            this.Size = new System.Drawing.Size(424, 208);
            this.ResumeLayout(false);

        }
        #endregion
    }

    public class InternalWizardPage : WizardPage
    {
        public WizardBanner Banner;
        private System.ComponentModel.IContainer components = null;

        public InternalWizardPage()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Banner = new WizardBanner();
            this.SuspendLayout();
            // 
            // Banner
            // 
            this.Banner.BackColor = System.Drawing.SystemColors.Window;
            this.Banner.Dock = System.Windows.Forms.DockStyle.Top;
            this.Banner.Location = new System.Drawing.Point(0, 0);
            this.Banner.Name = "Banner";
            this.Banner.Size = new System.Drawing.Size(432, 64);
            this.Banner.Subtitle = "Subtitle";
            this.Banner.TabIndex = 0;
            this.Banner.Title = "Title";
            // 
            // InternalWizardPage
            // 
            this.Controls.Add(this.Banner);
            this.Name = "InternalWizardPage";
            this.Size = new System.Drawing.Size(432, 150);
            this.ResumeLayout(false);

        }
        #endregion
    }

    public class WizardBanner : System.Windows.Forms.UserControl
    {
        private System.Windows.Forms.Label titleLabel;
        private System.Windows.Forms.Label subtitleLabel;
        private EtchedLine etchedLine1;
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public WizardBanner()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // Avoid getting the focus.
            this.SetStyle(ControlStyles.Selectable, false);
        }

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.titleLabel = new System.Windows.Forms.Label();
            this.subtitleLabel = new System.Windows.Forms.Label();
            this.etchedLine1 = new EtchedLine();
            this.SuspendLayout();
            // 
            // titleLabel
            // 
            this.titleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.titleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.titleLabel.Location = new System.Drawing.Point(16, 8);
            this.titleLabel.Name = "titleLabel";
            this.titleLabel.Size = new System.Drawing.Size(432, 16);
            this.titleLabel.TabIndex = 0;
            this.titleLabel.Text = "Title";
            // 
            // subtitleLabel
            // 
            this.subtitleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.subtitleLabel.Location = new System.Drawing.Point(40, 24);
            this.subtitleLabel.Name = "subtitleLabel";
            this.subtitleLabel.Size = new System.Drawing.Size(408, 32);
            this.subtitleLabel.TabIndex = 1;
            this.subtitleLabel.Text = "Subtitle";
            // 
            // etchedLine1
            // 
            this.etchedLine1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.etchedLine1.Edge = EtchEdge.Bottom;
            this.etchedLine1.Location = new System.Drawing.Point(0, 56);
            this.etchedLine1.Name = "etchedLine1";
            this.etchedLine1.Size = new System.Drawing.Size(456, 8);
            this.etchedLine1.TabIndex = 0;
            // 
            // WizardBanner
            // 
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.etchedLine1);
            this.Controls.Add(this.subtitleLabel);
            this.Controls.Add(this.titleLabel);
            this.Name = "WizardBanner";
            this.Size = new System.Drawing.Size(456, 64);
            this.ResumeLayout(false);

        }
        #endregion

        [Category("Appearance")]
        public string Title
        {
            get { return titleLabel.Text; }
            set { titleLabel.Text = value; }
        }

        [Category("Appearance")]
        public string Subtitle
        {
            get { return subtitleLabel.Text; }
            set { subtitleLabel.Text = value; }
        }
    }

    [DefaultEvent("SetActive")]
    public class WizardPage : System.Windows.Forms.UserControl
    {
        private System.ComponentModel.Container components = null;

        public WizardPage()
        {
            InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();
        }
        #endregion

        protected WizardSheet GetWizard()
        {
            WizardSheet wizard = (WizardSheet)this.ParentForm;
            return wizard;
        }

        protected void SetWizardButtons(WizardButtons buttons)
        {
            GetWizard().SetWizardButtons(buttons);
        }

        protected void EnableCancelButton(bool enableCancelButton)
        {
            GetWizard().EnableCancelButton(enableCancelButton);
        }

        protected void PressButton(WizardButtons buttons)
        {
            GetWizard().PressButton(buttons);
        }

        [Category("Wizard")]
        public event CancelEventHandler SetActive;

        public virtual void OnSetActive(CancelEventArgs e)
        {
            if (SetActive != null)
                SetActive(this, e);
        }

        [Category("Wizard")]
        public event WizardPageEventHandler WizardNext;

        public virtual void OnWizardNext(WizardPageEventArgs e)
        {
            if (WizardNext != null)
                WizardNext(this, e);
        }

        [Category("Wizard")]
        public event WizardPageEventHandler WizardBack;

        public virtual void OnWizardBack(WizardPageEventArgs e)
        {
            if (WizardBack != null)
                WizardBack(this, e);
        }

        [Category("Wizard")]
        public event CancelEventHandler WizardFinish;

        public virtual void OnWizardFinish(CancelEventArgs e)
        {
            if (WizardFinish != null)
                WizardFinish(this, e);
        }

        [Category("Wizard")]
        public event CancelEventHandler QueryCancel;

        public virtual void OnQueryCancel(CancelEventArgs e)
        {
            if (QueryCancel != null)
                QueryCancel(this, e);
        }
    }

    public class WizardSidebar : System.Windows.Forms.UserControl
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public WizardSidebar()
        {
            this.Dock = DockStyle.Left;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // Set a default image.
            //Bitmap image = new Bitmap(this.GetType(), "Bitmaps.ExampleSidebar.bmp");
            //this.BackgroundImage = image;

            // Avoid getting the focus.
            this.SetStyle(ControlStyles.Selectable, false);
        }

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            // 
            // WizardSidebar
            // 
            this.Name = "WizardSidebar";
            this.Size = new System.Drawing.Size(165, 320);
        }
        #endregion
    }

    public class WAI_Wizard : WizardSheet
    {
        private System.ComponentModel.IContainer components = null;
        
        public WAI_Wizard()
        {
            
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            this.Pages.Add(new WelcomePage());
            this.Pages.Add(new create_open_dialog());
            this.Pages.Add(new Step_Requirements());
            this.Pages.Add(new Step_LicenseFile());
            this.Pages.Add(new Step_Target());
            this.Pages.Add(new Step_SourcePath());
            this.Pages.Add(new Step_FolderRights());
            this.Pages.Add(new Step_Storage());
            this.Pages.Add(new Step_config_files());
            this.Pages.Add(new EndPage());
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            // 
            // WizardSheet
            // 
            this.AutoScaleBaseSize = new Size(5, 13);
            this.ClientSize = new Size(384, 141);
            this.Name = "WAI_Wizard";
            this.Load += new EventHandler(this.WAI_Wizard_Load);

        }
        #endregion

        private void WAI_Wizard_Load(object sender, EventArgs e)
        {

        }
    }
}
